function ech_n_1() {
	$.ajax({
		type: 'get',
		url: "new_file.json", //请求数据的地址
		dataType: "json", //返回数据形式为json
		success: function(result) {
			var myChart = echarts.init(document.getElementById("ech_n_1"));
			var data_dongtai = [{
				name: "台州市本级",
				value: [1064, 976, 91.7]
			}, {
				name: "县(市、区)",
				value: [939, 837, 89.5]
			}, {
				name: "乡镇",
				value: [88, 81, 91.9]
			}];
			var radius = [135, 155];
			var h = ['18%', '53%', '83%']
			var w = ['50%', '50%', '50%']
			var color1 = ['#f2e515', '#4cf694', '#196aff', ]
			var label_dongtai = [];
			for(var i = 0; i < data_dongtai.length; i++) {
				label_dongtai.push(data_dongtai[i].name);
			}
			option = {
				series: []
			};
			for(var i = 0; i < data_dongtai.length; i++) {
				if(i == data_dongtai.length - 1) {
					formatter = '{b}' + '\n{c}' + '%';
				} else {
					formatter = '{b}\n{c}' + '项'
				}
				option.series.push({
					type: 'pie',
					center: [h[i], w[i]],
					radius: radius,
					hoverAnimation: false,
					label: {
						show: true,
						position: 'outside',
						color: '#ddd',
						fontSize: 24,
						formatter: formatter
					},
					labelLine: {
						show: false
					},
					data: [{
						name: label_dongtai[0],
						value: data_dongtai[0].value[i],
						itemStyle: {
							normal: {
								color: color1[0]
							}
						}
					}, {
						name: label_dongtai[1],
						value: data_dongtai[1].value[i],
						itemStyle: {
							normal: {
								color: color1[1]
							}
						}
					}, {
						name: label_dongtai[2],
						value: data_dongtai[2].value[i],
						itemStyle: {
							normal: {
								color: color1[2]
							}
						}
					}]
				});
			};

			if(option && typeof option === "object") {
				myChart.setOption(option, true);
			}
		},
	});

}

function ech_n_2() {
	var myChart = echarts.init(document.getElementById("ech_n_2"));
	var category = [];
	var topData = [99.97];
	var bottomData = [99.06];
	var outlineData = [102];
	var bodyMax = 100;
	var fillImg = 'img/jindu.png'
	var bgImg = 'img/jindu-bg.png'
	option = {
		grid: [{
			top: 45,
			left: 10,
			right: 150
		}],
		xAxis: {
			show: false
		},
		yAxis: {
			data: category,
			show: false
		},
		series: [{ // 背景图
				type: 'pictorialBar',
				symbol: 'image://' + bgImg,
				symbolOffset: [-13, 0],
				symbolSize: ['115%', '255%'],
				data: outlineData,
			},
			{ // 蓝柱
				type: 'pictorialBar',
				symbol: 'image://' + fillImg,
				symbolOffset: [0, '-150%'],
				symbolSize: ['100%', '30%'],
				symbolClip: true,
				symbolBoundingData: bodyMax,
				data: topData,
				animationDelay: function(dataIndex, params) {
					return params.index * 30 * 1.1
				}
			},
			{ // 红柱
				type: 'pictorialBar',
				symbol: 'image://' + fillImg,
				symbolClip: true,
				symbolBoundingData: bodyMax,
				symbolOffset: [0, '340%'],
				itemStyle: {
					normal: {
						barBorderRadius: 5,
						color: '#ed3e6d'
					}
				},
				symbolSize: ['100%', '30%'],
				data: bottomData,
				animationDelay: function(dataIndex, params) {
					return params.index * 30 * 1.1
				}
			}
		],
		animation: true
	};
	if(option && typeof option === "object") {
		myChart.setOption(option, true);
	}

}

function ech_n_3() {
	$.ajax({
		type: 'get',
		url: "new_file.json", //请求数据的地址
		dataType: "json", //返回数据形式为json
		success: function(result) {
			var myChart = echarts.init(document.getElementById("ech_n_3"));
			var data_dongtai = [{
				name: '视频监控-摄像头',
				value: 5.3,
				total: 5.5
			}, {
				name: '车辆卡口',
				value: 1.4,
				total: 1.5
			}, {
				name: '"阳光厨房"',
				value: 2171,
				total: 2171
			}, {
				name: '餐饮单位-高清摄像头',
				value: 9246,
				total: 9300
			}];
			var radius = [82, 90];
			var h = ['50%', '50%', '50%', '50%']
			var w = ['10%', '28%', '46%', '64%']
			var color1 = ['#f9bc00', '#8ac22d', '#209ad7', '#e6e636']
			var color2 = ['#f19701', '#47b132', '#007ecb', '#b2d000']
			var label_dongtai = [];
			for(var i = 0; i < data_dongtai.length; i++) {
				label_dongtai.push(data_dongtai[i].name);
			}

			option = {
				series: []
			};
			for(var i = 0; i < data_dongtai.length; i++) {
				option.series.push({
					type: 'pie',
					startAngle: 140,
					center: [h[i], w[i]],
					radius: radius,
					hoverAnimation: false,
					label: {
						show: true,
						fontSize: 24,
						padding: [60, 0, 0, 0],
						position: 'center',
						formatter: function(val) { //让series 中的文字进行换行
							var value = 1;
							var tit = "";
							switch(val.name){
								case '视频监控-摄像头':
								value = val.value;
								tit = "万";
								break;
								case '车辆卡口':
								value = val.value;
								tit = "万";
								break;
								case '"阳光厨房"':
								value = val.value;
								tit = "家";
								break;
								case '餐饮单位-高清摄像头':
								value = val.value;
								tit = "个";
								break;
							}
							return "{a|"+value+"}"+tit+"\n"+ val.name.split("-").join("\n");
						},
						rich:{
							a:{
						fontSize: 42,
							}
						}

					},
					x: '0%',
					itemStyle: {
						normal: {
							color: color1[i],

						}
					},
					data: [{
						name: data_dongtai[i].name,
						value: data_dongtai[i].value,
					}, {
						name: '',
						value: data_dongtai[i].total - data_dongtai[i].value,
						itemStyle: {
							normal: {
								label: {
									show: false
								},
								labelLine: {
									show: false
								},
								color: 'rgba(0,0,0,0)',
								borderColor: 'rgba(0,0,0,0)',
								borderWidth: 0
							}
						}
					}]
				}, {
					center: [h[i], w[i]],
					radius: [75, 85],
					hoverAnimation: false,
					type: "pie",
					startAngle: 140,
					data: [{
						name: data_dongtai[i].name,
						value: data_dongtai[i].value,
						label: {
							normal: {
								show: false,
								position: "center"
							}
						},
						labelLine: {
							show: false
						},
						itemStyle: {
							normal: {
								color: color2[i],
							},
						},
					}, {
						name: '',
						value: data_dongtai[i].total - data_dongtai[i].value,
						itemStyle: {
							normal: {
								label: {
									show: false
								},
								labelLine: {
									show: false
								},
								color: 'rgba(0,0,0,0)',
								borderColor: 'rgba(0,0,0,0)',
								borderWidth: 0
							}
						}
					}]

				});
			};

			if(option && typeof option === "object") {
				myChart.setOption(option, true);
			}
		},
	});

}

function ech_n_4() {
	$.ajax({
		type: 'get',
		url: "new_file.json", //请求数据的地址
		dataType: "json", //返回数据形式为json
		success: function(result) {
			var myChart = echarts.init(document.getElementById("ech_n_4"));
			var data_dangyuan = [{
					value: 5,
					name: '其他党派'
				},
				{
					value: 80,
					name: '党员'
				},
				{
					value: 10,
					name: '群众'
				}
			];
			var data_xueli = [{
					value: 5,
					name: '高中'
				},
				{
					value: 80,
					name: '大学生'
				},
				{
					value: 10,
					name: '博士'
				},
				{
					value: 5,
					name: '研究生'
				}
			];
			option = {
				color: ['#f2e515', '#4bbeed', '#4cf694', '#f2e515', '#4bbeed', '#4cf694', '#fd8259'],
				series: [

					{
						type: 'pie',
						radius: [60, 100],
						center: ['20%', '50%'],
						label: {
							normal: {
								show: true,
								color: 'white',
								fontSize: 24
							}
						},
						labelLine: {
							length2: 50
						},
						data: data_dangyuan
					},
					{
						type: 'pie',
						radius: [60, 100],
						center: ['80%', '50%'],
						label: {
							normal: {
								show: true,
								color: 'white',
								fontSize: 24
							}
						},
						labelLine: {
							length2: 50
						},
						data: data_xueli
					}
				]
			};;
			if(option && typeof option === "object") {
				myChart.setOption(option, true);
			}
		},
	});

}